<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('问卷列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>问卷名称：</label>
                                <input type="text" name="questionnaireName"/>
                            </li>
                            <li>
                                <label>问卷分类：</label>
                                <input type="text" name="categoryId"/>
                            </li>
                            <li>
                                <label>是否发布：</label>
                                <input type="text" name="isPublish"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
           
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('qa:questionnaire:edit')}]];
        var removeFlag = [[${@permission.hasPermi('qa:questionnaire:remove')}]];
        var prefix = ctx + "qa/questionnaire";

        $(function() {
            var options = {
                url: prefix + "/list",
                showSearch: false,
		        showRefresh: false,
		        showToggle: false,
		        showColumns: false,
                modalName: "问卷",
                columns: [{
                	radio: true
                },
                {
                    field: 'questionnaireId',
                    title: '问卷主键',
                    visible: false
                },
                {
                    field: 'questionnaireName',
                    title: '问卷名称'
                }
                
               ]
            };
            $.table.init(options);
        });
        
        
		/* 添加用户-选择用户-提交 */
		function submitHandler() {
			var rows = $.table.selectFirstColumns();
			if (rows.length == 0) {
       			$.modal.alertWarning("请选择一条记录");
       			return;
       		}
			$.modal.close();
			parent.$('#itemTypeId').val($.table.selectColumns('questionnaireId'));
			parent.$('#itemTypeName').val($.table.selectColumns('questionnaireName'));
		}
    </script>
</body>
</html>